package cn.isjinhao.se.sql.grammar.statement.retrieve.represention;

import cn.isjinhao.se.sql.grammar.CurdStatement;
import cn.isjinhao.se.sql.grammar.CurdStatementVisitor;

import java.util.List;

/**
 * @Author ISJINHAO
 * @Date 2021/8/15 21:23
 */
public class CaseWhen extends CurdStatement {

    private CurdStatement value;

    private List<CurdStatement> conditionList;

    private List<CurdStatement> resultList;

    private CurdStatement defaultValue;

    public CaseWhen(CurdStatement value, List<CurdStatement> conditionList, List<CurdStatement> resultList, CurdStatement defaultValue) {
        this.value = value;
        this.conditionList = conditionList;
        this.resultList = resultList;
        this.defaultValue = defaultValue;
    }

    @Override
    public <R> R accept(CurdStatementVisitor<R> curdStatementVisitor) {
        return curdStatementVisitor.visitCaseWhen(this);
    }

    public CurdStatement getValue() {
        return value;
    }

    public CurdStatement getDefaultValue() {
        return defaultValue;
    }

    public List<CurdStatement> getConditionList() {
        return conditionList;
    }

    public List<CurdStatement> getResultList() {
        return resultList;
    }

}
